import 'package:k3cloud_api/params/request_param.dart';

/// it is used to build parameters to request the workflow audit interface.
class WorkflowAuditParam extends RequestParam {
  @override
  String getRequestPath() {
    return "DynamicFormService.WorkflowAudit";
  }

  @override
  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = {};
    if (formId != null) data["formId"] = formId;
    if (numbers != null) data["numbers"] = numbers;
    if (ids != null) data["ids"] = ids;
    if (userId != null) data["userId"] = userId;
    if (userName != null) data["userName"] = userName;
    if (actionResultId != null) data["actionResultId"] = actionResultId;
    if (postId != null) data["postId"] = postId;
    if (postNumber != null) data["postNumber"] = postNumber;
    return data;
  }

  String? formId;
  List<String>? numbers;
  String? ids;
  int? userId;
  String? userName;
  int? approvalType;
  String? actionResultId;
  int? postId;
  String? postNumber;

  static _Builder builder() {
    return _Builder();
  }
}

class _Builder {
  final WorkflowAuditParam _param = WorkflowAuditParam();

  WorkflowAuditParam build() => _param;
  
  _Builder formId(String formId) {
    _param.formId = formId;
    return this;
  }

  _Builder numbers(List<String> numbers) {
    _param.numbers = numbers;
    return this;
  }

  _Builder ids(List<int> ids) {
    _param.ids = ids.join(",");
    return this;
  }

  _Builder userId(int userId) {
    _param.userId = userId;
    return this;
  }

  _Builder userName(String userName) {
    _param.userName = userName;
    return this;
  }

  _Builder approvalType(int approvalType) {
    _param.approvalType = approvalType;
    return this;
  }

  _Builder actionResultId(String actionResultId) {
    _param.actionResultId = actionResultId;
    return this;
  }

  _Builder postId(int postId) {
    _param.postId = postId;
    return this;
  }

  _Builder postNumber(String postNumber) {
    _param.postNumber = postNumber;
    return this;
  }
}